package com.example.springfeature.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Slf4j
@Component
@RabbitListener(queues = "hello")  //监听某队列
public class SimpleReceiver {

    /**
     * 接收 队列里的 msg
     * @param Str
     */
    @RabbitHandler
    public void process(String Str) {
        log.warn("接收消息："+Str);
        log.warn("接收消息时间："+new Date());
    }



}
